package com.yc.jpyy.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

public class CalenderTest {
       public static void main(String[] args) {
    	   
    	   String string = "true";
    	   String string1 = "1";
   		   boolean b = Boolean.parseBoolean(string);
   		   boolean b1 = Boolean.parseBoolean(string1);
   		   boolean b2 = Boolean.valueOf(string).booleanValue();
   		   System.out.println(b);
   		   System.out.println(b1);
   		   System.out.println(b2);

   	    
    	   System.out.println("请输入第一个日期：yyyy-MM-dd");
    	   Scanner s = new Scanner(System.in); 
    	   String strDateStar = s.next();
    	   
    	   System.out.println("请输入第二个日期：yyyy-MM-dd");
    	   Scanner s1 = new Scanner(System.in); 
    	   String strDateEnd = s1.next();
    	   
    	   
    	   try{
    	    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    	    
    	    Date dateStart = sdf.parse(strDateStar );
    	    Date dateEnd = sdf.parse(strDateEnd );
    	    
    	    System.out.println((dateEnd.getTime() - dateStart.getTime())/86400000/7);
    	   } catch(Exception ex){
    		   
    		   ex.printStackTrace();
    		  }
    		  
	}
}
